A stereo method that uses the principle of triangulation is well known to three-dimensionally measure an object to be measured (hereinafter, simply referred to as a “work”) from an image captured by a camera. In the stereo method, generally, an image of the work is captured by a stereo camera that has been calibrated and the work is three-dimensionally measured by using the disparity between left and the right cameras.
On the other hand, when the contrast of the work is low, such as in a case of an uneven portion of a black work, it is known that a light-section method which is a type of the stereo method can be used. In the light-section method, a projector projects slit light onto the work and a three-dimensional measuring is performed by using a captured image of the work which is projected by the slit light. More specifically, in the light-section method, a three-dimensional plane equation of a light-section plane of the slit light to be projected is obtained in advance and an image of a bright line on the work projected by the slit light is captured by a camera. Then, the three-dimensional measuring is performed on the basis of the principle of triangulation from the position of the bright line on the obtained image and the three-dimensional plane equation of the light-section plane obtained in advance.
By the way, in the light-section method, if the number of the slit lights projected from the projector is one, when measuring the entire shape of the work, an image of the work has to be captured a plurality of times while moving the work or the slit light. Therefore, conventionally, a three-dimensional measuring apparatus which projects a plurality of slit lights at the same time from a projector is proposed (see PTL 1) so that the number of times of the image capturing is small when performing the three-dimensional measuring of the work.
Here, when a plurality of slit lights are projected onto the work, to perform the three-dimensional measuring, it is necessary to identifies a correspondence between each of a plurality of bright lines on the captured image and a plurality of light-section planes. Therefore, the three-dimensional measuring apparatus described in PTL 1 uses a color light source in the projector and sequentially changes colors of the bright lines so that the colors of adjacent bright lines (slit lights) are different from each other. The image of the bright lines having different colors is captured by a camera, so that the bright lines and the light-section planes correspond to each other on the basis of the colors of the bright lines.